﻿using System;

namespace Xtee.Core.Strings
{
    ///borrowed from : http://haacked.com/archive/2009/01/04/fun-with-named-formats-string-parsing-and-edge-cases.aspx
    public class LiteralFormat : ITextExpression
    {
        public LiteralFormat(string literalText)
        {
            LiteralText = literalText; 
        }

        public string LiteralText
        {
            get;
            private set;
        }

        public string Eval(object o)
        {
            string literalText = LiteralText
                .Replace("[[", "]")
                .Replace("]]", "]");
            return literalText;
        }
    }
}
